<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class checkLogin
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        // 中间件 用户标识验证
        if( Auth::guard('back')->check() ){
            return $next($request);
        }else{
           return redirect('/back/login');//检测不通过，直接登录
        }

    }
}
